import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
// 引入element-plus
import ElementPlus from 'element-plus'
import locale from 'element-plus/es/locale/lang/zh-cn'
// 引入element-plus 样式
import 'element-plus/dist/index.css'
// 引入element-plus图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 引入全局css
import './assets/css/public.css'
import './assets/css/element.css'
// 引入重写message
import './assets/js/message.js'
const app = createApp(App)

// 注册全局组件
import Header from './components/Header.vue'
app.component('Header', Header)

// 循环引入element-plus图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 引入pinia
import { createPinia } from 'pinia'
const pinia = createPinia()
// 挂载
app.use(ElementPlus, { locale }).use(pinia).use(router).mount('#app')
